var SetT_Setting = setTimeout(function () { $(".Box-Setting").css("height", BoxHeight); }, 1000);
function SetLeftPX() {
} (function ($) {
    $.fn.ShowImage = function (options) { //图片载入效果，唧唧原创
        var This = this;
        var Temp_SetI;
        Temp_SetI = setInterval(function () {
            if ($(This)[0].complete) {
                $(This).parent().find("img:eq(0)").css("margin-top", "-100%");
                setTimeout(function () { $(This).parent().find("img:eq(0)").remove(); }, 2000);
                clearInterval(Temp_SetI);
            }
        }, 100);
    }
})(jQuery);
$(".ImageLoad").each(function () {
    $(this).ShowImage();
});
try {
    $(".HomeLinks").css("left", $(window).width() - $(".HomeLinks").width() - 50);
    setTimeout(function () {
        $(".HomeLinks").css("left", "99.5%");
    }, 10000);
}
catch (e) { }
$(".Links").mouseenter(function () { $(this).css("left", ($(window).width() - $(this).width() - 50) + "px"); });
$(".Links").mouseleave(function () { $(this).css("left", "99.5%"); });
var YY_Status = 0;
var SetI;
var HitoPause = false;
function yy(data) {
    if (HitoPause) {
        setTimeout(function () { yy(data); }, 500);
        return;
    }
    $("#hito").html(data["hitokoto"] + "<br><div style='text-align: right;'>— " + data["source"] + "</div>");
    clearInterval(SetI);
    SetI = setInterval(function () { $(".hito").css("margin-top", ($(".hito").parent().parent().height() - $(".hito").height()) / 2 - 10); }, 100);
    switch (YY_Status) {
        case 0:
            $(".MYTime").css("left", $(".MYTime").width() + "px");
            YY_Status++;
            break;
        case 1:
            $(".MYTime").css("left", "0px");
            YY_Status++;
            break;
        case 2:
            $(".MYTime").css("left", "-" + $(".MYTime").width() + "px");
            YY_Status++;
            break;
        case 3:
            $(".MYTime").css("left", "0px");
            YY_Status = 0;
            break;
    }
    setTimeout(function () { hjs.remove(); hjs = document.createElement('script'); hjs.setAttribute('src', 'http://hitokoto.bilibilijj.com/?status=get&funname=yy'); document.body.appendChild(hjs); }, 15000);
}
$("#hito").parent().parent().mouseleave(function () { HitoPause = false; })
$("#hito").parent().parent().mouseenter(function () { HitoPause = true; })
var hjs = document.createElement('script');
setTimeout(function () { hjs.setAttribute('src', 'http://hitokoto.bilibilijj.com/?status=get&funname=yy'); document.body.appendChild(hjs); }, 10);
var browser = {
    versions: function () {
        var u = navigator.userAgent, app = navigator.appVersion;
        return {
            mobile: (!!u.match(/AppleWebKit.*Mobile/) || !!u.match(/Windows Phone/) || !!u.match(/Android/) || !!u.match(/MQQBrowser/)) && u.indexOf("QQ/"), //是否为移动终端                
        };
    }()
}
if (browser.versions.mobile.toString().toLowerCase() != "true" && window.localStorage.ShowAD!="false") {
    if (window.localStorage) {
        var d = new Date();
        var nowtime = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();
        if (!window.localStorage.A_DRightB || window.localStorage.A_DRightB != nowtime && window.localStorage.ShowAD != "false") {
            setTimeout(function () { window.localStorage.A_DRightB = nowtime; }, 5000);
            
        }
        else {
            if (!window.localStorage.A_DRightB_2 || window.localStorage.A_DRightB_2 != nowtime) {
                setTimeout(function () { window.localStorage.A_DRightB_2 = nowtime; }, 3000);
            }
            else {
                if (!window.localStorage.A_DRightB_3 || window.localStorage.A_DRightB_3 != nowtime) {
                    setTimeout(function () { window.localStorage.A_DRightB_3 = nowtime; }, 3000);
                }
            }
        }
    }
}

var GGHomeVer = "45";
var GGData = "2017-01-03 クリスマスでも、新年でも、いつも通り一人ぽっち...&nbsp;&nbsp;<a style='color:#FFCB5E;' href='http://weibo.com/3858859362/Ep5hcaQw4?from=page_1005053858859362_profile&wvr=6&mod=weibotime' target='_blank'>壁纸下载</a>&nbsp;&nbsp;&nbsp;&nbsp;<a style='color:#FFCB5E;' href='http://www.pixiv.net/member_illust.php?mode=medium&illust_id=60731627' target='_blank'>作者：あさひ＠KyoD＋</a>";
function CloseGG() {
    window.localStorage.GGHomeVer = GGHomeVer;
    $(".GG").css("bottom", "-100px");
}
if (!window.localStorage.GGHomeVer || window.localStorage.GGHomeVer != GGHomeVer) {
    $(".GG").html(GGData + "<span style='cursor:pointer;margin-left:10px;' onclick='CloseGG();'>关闭</span>");
    $(".GG").css("bottom", "0px");
}

//StartSMS();

function ShowXX() {
    if (!window.localStorage.XX1) { $.ajax({ type: "GET", async: false, url: "/base64/xx1.txt", data: { t: Math.random() }, dataType: "text", success: function (data) { window.localStorage.XX1 = data; } }); }
    if (!window.localStorage.XX2) { $.ajax({ type: "GET", async: false, url: "/base64/xx2.txt", data: { t: Math.random() }, dataType: "text", success: function (data) { window.localStorage.XX2 = data; } }); }
    for (var i = 0; i < 70; i++) {
        var Top = Math.random() * ($(window).height() / 3);
        var Left = Math.random() * $(window).width();
        var Temp = "<img src='" + window.localStorage.getItem("XX" + parseInt(1 + Math.random() * 2)) + "' style='position: fixed; top:" + Top + "px; left:" + Left + "px;z-index:-1;'/>";
        $("body").append(Temp);
    }
}

function getArgs() {
    var args = {};
    var match = null;
    var search = decodeURIComponent(location.search.substring(1));
    var reg = /(?:([^&]+)=([^&]+))/g;
    while ((match = reg.exec(search)) !== null) {
        args[match[1]] = match[2];
    }
    return args;
}

if (getArgs()["access_key"] != "" && getArgs()["access_key"] != null) {
    window.localStorage.UpToken = getArgs()["access_key"];
    window.location.href = "/UpAdmin";
}

var MaMaA;
function ShowMaMa() {
    MaMaA = setInterval(function () {
        if ($(".A_DList iframe").length > 0) {
            $(".A_DList iframe").css("margin-top", ($(".Box-40x40").height() - $(".A_DList iframe").height()) / 2);
            $(".A_DList iframe").css("margin-left", ($(".Box-40x40").width() - $(".A_DList iframe").width()) / 2);
            $("#ManMi").css("display", "none");
        }
        else {
            $("#ManMi").css("display", "block");
        }
    }, 100);
}
ShowMaMa();

//$('body').mousewheel(function (event, delta, deltaX, deltaY) {
//    if (delta == 1) {
//        if (Audio_.volume < 1) {
//            if (Audio_.volume > 0.95) {
//                Audio_.volume = 1;
//            }
//            else {
//                Audio_.volume += 0.03;
//            }
//        }
//    }
//    else {
//        if (Audio_.volume > 0) {
//            if (Audio_.volume < 0.03) {
//                Audio_.volume = 0;
//            }
//            else {
//                Audio_.volume -= 0.03;
//            }
//        }
//        Old_Volume = Audio_.volume;
//        window.localStorage.Volume = Old_Volume;
//    }
//    $(".sound:eq(0)").css("width", Audio_.volume * 100 + "%");
//});


//EndSub